package com.uum.common.core.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="SysOperationLog对象", description="")
public class SysOperationLog implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "微服务名字")
    private String microService;

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "接口描述")
    private String interfaceDepict;

    @ApiModelProperty(value = "业务类型（0其他 1新增 2修改 3删除")
    private Integer businessType;

    @ApiModelProperty(value = "接口类")
    private String methodClass;

    @ApiModelProperty(value = "请求方式")
    private String requestMethod;

    @ApiModelProperty(value = "请求的url")
    private String requestUrl;

    @ApiModelProperty(value = "操作时的ip")
    private String operatorIp;

    @ApiModelProperty(value = "操作地点")
    private String operatorLocation;

    @ApiModelProperty(value = "请求参数")
    private String operationParam;

    @ApiModelProperty(value = "返回参数")
    private String jsonResult;

    @TableField(fill = FieldFill.INSERT)
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "操作时间")
    private LocalDateTime operationTime;

    @ApiModelProperty(value = "操作状态（0成功 1失败）")
    private String status;

    @ApiModelProperty(value = "错误消息")
    private String errorMsg;


}
